package br.com.skytef.dao;

public class SqlPayment {

	/*******************************************************************************************
	 * INSERT
	 ********************************************************************************************/
	
	public static String getQryInsertPayment() {
		StringBuffer sql = new StringBuffer();

		sql.append("INSERT INTO pagamento ");
		sql.append("            (idticket, ");
		sql.append("             ativo, ");
		sql.append("             tipoorigem, ");
		sql.append("             datacriacao, ");
		sql.append("             dataDocumento, "); 
		sql.append("             dataVencimento, "); 
		sql.append("             dataPgto, ");
		sql.append("             momentopgto, ");
		sql.append("             formapgto, ");
		sql.append("             valortarifa, ");
		sql.append("             multa, ");
		sql.append("             juros, ");
		sql.append("             descontos, ");
		sql.append("             valorpago, ");
		sql.append("             obs) ");
		sql.append("VALUES      (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); ");
		
		return sql.toString();
	}
	

	/*******************************************************************************************
	 * SELECT
	 ********************************************************************************************/
	public static String getQrySelectPayment() {
		StringBuffer sql = new StringBuffer();

		sql.append("SELECT idpagamento, ");
		sql.append("       idticket, ");
		sql.append("       ativo, ");
		sql.append("       tipoorigem, ");
		sql.append("       datacriacao, ");
		sql.append("       dataDocumento, "); 
		sql.append("       dataVencimento, "); 
		sql.append("       dataPgto, ");
		sql.append("       momentopgto, ");
		sql.append("       formapgto, ");
		sql.append("       valortarifa, ");
		sql.append("       multa, ");
		sql.append("       juros, ");
		sql.append("       descontos, ");
		sql.append("       valorpago, ");
		sql.append("       obs ");
		sql.append("FROM   pagamento ");
		sql.append("WHERE  idpagamento = ?; ");
		
		return sql.toString();
	}
	
	public static String getQrySelectPaymentByTicket() {
		StringBuffer sql = new StringBuffer();

		sql.append("SELECT idpagamento, ");
		sql.append("       idticket, ");
		sql.append("       ativo, ");
		sql.append("       tipoorigem, ");
		sql.append("       datacriacao, ");
		sql.append("       dataDocumento, "); 
		sql.append("       dataVencimento, "); 
		sql.append("       dataPgto, ");
		sql.append("       momentopgto, ");
		sql.append("       formapgto, ");
		sql.append("       valortarifa, ");
		sql.append("       multa, ");
		sql.append("       juros, ");
		sql.append("       descontos, ");
		sql.append("       valorpago, ");
		sql.append("       obs ");
		sql.append("FROM   pagamento ");
		sql.append("WHERE  idticket = ?; ");
		
		return sql.toString();
	}
	
	/*******************************************************************************************
	 * UPDATE
	 ********************************************************************************************/
	public static String getQryUpdatePayment() {
		StringBuffer sql = new StringBuffer();

		sql.append("UPDATE pagamento ");
		sql.append("SET    idticket = ?, ");
		sql.append("       ativo = ?, ");
		sql.append("       tipoorigem = ?, ");
		sql.append("       datacriacao = ?, ");
		sql.append("       dataDocumento = ?, "); 
		sql.append("       dataVencimento = ?, "); 
		sql.append("       dataPgto = ?, ");
		sql.append("       momentopgto = ?, ");
		sql.append("       formapgto = ?, ");
		sql.append("       valortarifa = ?, ");
		sql.append("       multa = ?, ");
		sql.append("       juros = ?, ");
		sql.append("       descontos = ?, ");
		sql.append("       valorpago = ?, ");
		sql.append("       obs = ? ");
		sql.append("WHERE  idpagamento = ?; ");
		
		return sql.toString();
	}
	/*******************************************************************************************
	 * DELETE
	 ********************************************************************************************/
	public static String getQryDeletePayment() {
		StringBuffer sql = new StringBuffer();

		sql.append("DELETE FROM pagamento ");
		sql.append("WHERE  idpagamento = ?; ");

		return sql.toString();
	}

}
